/* testing structure and array assignment */


/* result should be:
 *
 * 10 false 0x0
 * 9 true 8 true 7 true 6 true 5 true 4 true 
 * 3 false 2 false 1 false 0 false  
 *
 * (and there is a \n between each pair of them)
 */

struct A{
  int a;
  bool b;
  struct A *c;
};


/*@*/
void f (int xxx)
{
  return;
}
/*@*/


/*@*/
int main(){
  struct A a, b;
  array[2, struct A *] c, d;
  int i;
  
  a.a = 10;
  a.b = false;
  a.c = NULL;
  b = a;
  print(b.a);
  printb(b.b);
  printp(b.c);

  i = 0;
  while (i<2){
    c[i] = alloc (struct A);
    (*(c[i])).a = i;
    (*(c[i])).b = (i>=4);
    (*(c[i])).c = NULL;
    i = i+1;
  }
  d = c;

/*
  while(i>0){
    i = i-1;
    print ((*(d[i])).a);
    printb((*(d[i])).b);
  }
  */
  i = 2;
  while(i>0){
    i = i-1;
    f ((d[i])->a);
    print ((d[i])->a);
    printb((d[i])->b);
  }
  return 0;
}
/*@*/
